package models

import (
	"github.com/goravel/framework/database/orm"
)

type Order struct {
	orm.Model
	UserID    uint64  `json:"user_id" gorm:"not null;constraint:OnDelete:CASCADE" form:"user_id"`
	ChapterID uint64  `json:"chapter_id" gorm:"nullable;constraint:OnDelete:SET NULL" form:"chapter_id"`
	SN        string  `json:"sn" gorm:"not null;comment:定单号" form:"sn"`
	Subject   string  `json:"subject" gorm:"not null;comment:订单描述" form:"subject"`
	Price     float64 `json:"price" gorm:"not null;comment:价格" form:"price"`
	PayState  bool    `json:"pay_state" gorm:"default:false;comment:支付状态" form:"pay_state"`
	PayType   string  `json:"pay_type" gorm:"nullable;comment:支付类型" form:"pay_type"`
	TradeNo   string  `json:"trade_no" gorm:"nullable;comment:支付平台单号" form:"trade_no"`
	Data      string  `json:"data" gorm:"type:text;nullable;comment:模块其他数据" form:"data"`
}
